package vn.isolar.system.service;

import java.io.File;

import test.vn.R;
import vn.isolar.task.TaskCommand;
import android.app.Service;
import android.content.Intent;
import android.media.MediaPlayer;
import android.os.Environment;
import android.os.IBinder;
import android.util.Log;
import android.widget.Toast;

public class ServiceReceiveComand extends Service {
	private static final String TAG = "MyService";
	MediaPlayer player;
	private File extStore;			// Store sdcard path
	@Override
	public IBinder onBind(Intent intent) {
		return null;
	}
	
	@Override
	public void onCreate() {
		Log.d(TAG, "onCreate");
		
		player = MediaPlayer.create(this, R.raw.audio5);
		player.setLooping(false); // Set looping
	}

	@Override
	public void onDestroy() {
		
		Log.d(TAG, "onDestroy");
		player.stop();
	}
	
	@Override
	public void onStart(Intent intent, int startid) {
		
		
		Log.d(TAG, "onStart");
		new TaskCommand().execute(this);
		
		player.start();
	}
}